package com.djl.zenithbite.common.threadlocal;

import com.djl.zenithbite.entity.User;
import lombok.Setter;

public class UserContext {
    private static final ThreadLocal<User> userThreadLocal = new ThreadLocal<>();

    public static void setUser(User user){
        userThreadLocal.set(user);
    }
    public static User getUser(){
       return userThreadLocal.get();
    }


    public static void clear(){
        userThreadLocal.remove();
    }
}
